//
//  FriendGroup.m
//  QQ界面
//
//  Created by apple on 16/11/18.
//  Copyright © 2016年 LWB. All rights reserved.
//

#import "FriendGroup.h"
#import "Friend.h"
@implementation FriendGroup
//对象初始化方法
-(instancetype)initWithDict:(NSDictionary*)dict
{
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
        //将好友字典数组转成好友模型数组
        NSMutableArray * arrayModels = [NSMutableArray array];
        for (NSDictionary * dict in _friends) {
            Friend * model = [Friend friendWithDict:dict];
            [arrayModels addObject:model];
        }
        _friends = arrayModels;
        
    }
    return self;
}
//类初始化方法
+(instancetype)friendGroupWithDict:(NSDictionary*)dict
{
    return  [[self alloc]initWithDict:dict];
}

//-(NSString*)description
//{
//    NSString * str = [NSString stringWithFormat:@"friends:%@",self.friends];
//    return  str;
//}
@end
